import request from '@/router/axios';
import { baseUrl } from '@/config/env';

export const readUserMenuByTree = (param) => request({
    url: baseUrl + '/user/read/menu',
    method: 'post',
    data:param
});

export const setUserMenu = (param) => request({
    url: baseUrl + '/user/update/menu',
    method: 'post',
    data:param
});

export const readSystemMenuByTree = (param) => request({
    url: baseUrl + '/menu/read/tree',
    method: 'post',
    data:param
});

export const readSystemMenuWhtiBtnsByTree = (param) => request({
    url: baseUrl + '/menu/read/tree/withbtns',
    method: 'post',
    data:param
});

export const addSystemMenu = (data) => request({
    url: baseUrl + '/menu/save',
    method: 'post',
    data:data
})

export const editSystemMenu = (data) => request({
    url: baseUrl + '/menu/save',
    method: 'post',
    data:data
})

export const delSystemMenu = (id) => request({
    url: baseUrl + '/menu/delete',
    method: 'post',
    data: { id: id }
})
